<?php	
	require_once('paths.inc');
	require_once('page.inc');
	require_once(DB_PATH.'db.inc');	
	require_once(INCLUDE_PATH.'constants.inc');
	require_once('utils.inc');
	
	session_start();
	checkIsLoggedIn();
	select_language();
	
	$db = db_connect();
				
	$cols = explode(',', $_SESSION['user_logat']->coloane_comenzi);
	$tip_raspuns = $_GET['tip'];	
?>
    <table class="capTabel" align="center" cellpadding="2" cellspacing="2" border="0" id="wrapperCustomFieldsComenzi">
    	<thead>
			<tr>
				<th colspan="5" align="center"><?php echo LANG_Choose_custom_field; ?></th>
			</tr>
		</thead>
		<tr class="capTabel">
			<td valign="top">
				<fieldset>
					<legend><?php echo LANG_Firma_solicitant; ?></legend>
					<table>
						<tr>
							<td>
								<input disabled <?php if (in_array("id_firma_sol", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="id_firma_sol" id="id_firma_sol"/>
								<label for="id_firma_sol"><?php echo LANG_Firma_sol; ?></label>
							</td>
						</tr>
						<tr>				
							<td>
								<input <?php if (in_array("nr_comanda_sol", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="nr_comanda_sol" id="nr_comanda_sol" />
								<label for="nr_comanda_sol"><?php echo LANG_Nr_comanda_sol; ?></label>
							</td>
						</tr>
						<tr>	
							<td>
								<input <?php if (in_array("nr_factura_sol", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="nr_factura_sol" id="nr_factura_sol" />
								<label for="nr_factura_sol"><?php echo LANG_Numar_factura_sol; ?></label>
							</td>			
						</tr>
						<tr>
							<td>
								<input <?php if (in_array("suma_sol", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="suma_sol" id="suma_sol" />
								<label for="suma_sol"><?php echo LANG_Suma_sol; ?></label>
							</td>
						</tr>				
						<tr>
							<td>
								<input <?php if (in_array("taxe_supl_to_sol", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="taxe_supl_to_sol" id="taxe_supl_to_sol" />
								<label for="taxe_supl_to_sol"><?php echo LANG_Taxa_suplimentara_to_sol; ?></label>
							</td>
						</tr>	
						<tr>
							<td>
								<input <?php if (in_array("penaliz_from_sol", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="penaliz_from_sol" id="penaliz_from_sol" />
								<label for="penaliz_from_sol"><?php echo LANG_Penalizare_from_sol; ?></label>
							</td>			
						</tr>		
						<tr>
							<td>
								<input <?php if (in_array("data_tr_acte_sol", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="data_tr_acte_sol" id="data_tr_acte_sol" />
								<label for="data_tr_acte_sol"><?php echo LANG_Data_tr_acte_sol; ?></label>
							</td>
						</tr>
						<tr>	
							<td>
								<input <?php if (in_array("suma_totala_sol", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="tel_mobil" id="suma_totala_sol" />
								<label for="suma_totala_sol"><?php echo LANG_Suma_totala_sol; ?></label>
							</td>
						</tr>
						<tr>
							<td>
								<input <?php if (in_array("moneda_sol", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="moneda_sol" id="moneda_sol" />
								<label for="moneda_sol"><?php echo LANG_Moneda_sol; ?></label>
							</td>			
						</tr>
					</table>
				</fieldset>
			</td>
			<td valign="top">
				<fieldset>
				<legend><?php echo LANG_Firma_executant; ?></legend>
					<table>
						<tr>
							<td>
								<input <?php if (in_array("id_firma_exec", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="id_firma_exec" id="id_firma_exec"/>
								<label for="id_firma_exec"><?php echo LANG_Firma_exec; ?></label>
							</td>
						</tr>
						<tr>				
							<td>
								<input <?php if (in_array("nr_comanda_exec", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="nr_comanda_exec" id="nr_comanda_exec" />
								<label for="nr_comanda_exec"><?php echo LANG_Nr_comanda_exec; ?></label>
							</td>
						</tr>
						<tr>	
							<td>
								<input <?php if (in_array("nr_factura_exec", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="nr_factura_exec" id="nr_factura_exec" />
								<label for="nr_factura_exec"><?php echo LANG_Numar_factura_exec; ?></label>
							</td>			
						</tr>
						<tr>
							<td>
								<input <?php if (in_array("suma_exec", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="suma_exec" id="suma_exec" />
								<label for="suma_exec"><?php echo LANG_Suma_exec; ?></label>
							</td>
						</tr>				
						<tr>
							<td>
								<input <?php if (in_array("taxe_supl_from_exec", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="taxe_supl_from_exec" id="taxe_supl_from_exec" />
								<label for="taxe_supl_from_exec"><?php echo LANG_Taxa_suplimentara_from_exec; ?></label>
							</td>
						</tr>	
						<tr>
							<td>
								<input <?php if (in_array("penaliz_to_exec", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="penaliz_to_exec" id="penaliz_to_exec" />
								<label for="penaliz_to_exec"><?php echo LANG_Penalizare_to_exec; ?></label>
							</td>			
						</tr>		
						<tr>
							<td>
								<input <?php if (in_array("data_primirii_acte_exec", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="data_primirii_acte_exec" id="data_primirii_acte_exec" />
								<label for="data_primirii_acte_exec"><?php echo LANG_data_primirii_acte_exec; ?></label>
							</td>
						</tr>
						<tr>	
							<td>
								<input <?php if (in_array("suma_totala_exec", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="suma_totala_exec" id="suma_totala_exec" />
								<label for="suma_totala_exec"><?php echo LANG_Suma_totala_exec; ?></label>
							</td>
						</tr>
						<tr>
							<td>
								<input <?php if (in_array("moneda_exec", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="moneda_exec" id="moneda_exec" />
								<label for="moneda_exec"><?php echo LANG_Moneda_exec; ?></label>
							</td>			
						</tr>
					</table>					
				</fieldset>
			</td>
			<td valign="top">
				<fieldset>
					<legend><?php echo LANG_Date; ?></legend>
					<table>
						<tr>
							<td>
								<input <?php if (in_array("data_scadenta_sol", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="data_scadenta_sol" id="data_scadenta_sol" />
								<label for="data_scadenta_sol"><?php echo LANG_Data_scadenta_sol; ?></label>
							</td>									
						</tr>
						<tr>
							<td>
								<input <?php if (in_array("data_scadenta_exec", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="data_scadenta_exec" id="data_scadenta_exec" />
								<label for="data_scadenta_exec"><?php echo LANG_Data_scadenta_exec; ?></label>
							</td>
						</tr>
						<tr>
							<td>
								<input <?php if (in_array("data_factura_sol", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="data_factura_sol" id="data_factura_sol" />
								<label for="data_factura_sol"><?php echo LANG_Data_factura_sol; ?></label>
							</td>										
						</tr>
						<tr>
							<td>
								<input <?php if (in_array("data_factura_exec", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="data_factura_exec" id="data_factura_exec" />
								<label for="data_factura_exec"><?php echo LANG_Data_factura_exec; ?></label>
							</td>
						</tr>
						<tr>
							<td>
								<input <?php if (in_array("data_comenzii", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="data_comenzii" id="data_comenzii" />
								<label for="data_comenzii"><?php echo LANG_Data_comenzii; ?></label>
							</td>
						</tr>
					</table>					
				</fieldset>
			</td>
			<td valign="top">
				<fieldset>
					<legend><?php echo LANG_Diverse; ?></legend>
					<table>
						<tr>
							<td>
								<input <?php if (in_array("nume_sofer", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="nume_sofer" id="nume_sofer" />
								<label for="nume_sofer"><?php echo LANG_Nume_sofer; ?></label>
							</td>
						</tr>		
						<tr>
							<td>
								<input <?php if (in_array("tel_sofer", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="tel_sofer" id="tel_sofer" />
								<label for="tel_sofer"><?php echo LANG_Telefon_sofer; ?></label>
							</td>
						</tr>		
						<tr>
							<td>
								<input <?php if (in_array("nr_inmatriculare", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="nr_inmatriculare" id="nr_inmatriculare" />
								<label for="nr_inmatriculare"><?php echo LANG_Numar_inmatriculare; ?></label>
							</td>
						</tr>									
						<tr>
							<td>
								<input <?php if (in_array("fel_camion", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="fel_camion" id="fel_camion" />
								<label for="fel_camion"><?php echo LANG_Fel_camion; ?></label>
							</td>
						</tr>																							
					</table>
				</fieldset>
			</td>
		</tr>
		<tr class="capTabel">
			<td valign="top">
				<fieldset>
					<legend><?php echo LANG_Acte_Exec; ?></legend>
					<table>
						<tr>
							<td>
								<input <?php if (in_array("_cmr_exec", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="_cmr_exec" id="_cmr_exec" />
								<label for="_cmr_exec"><?php echo LANG_cmr_exec; ?></label>
							</td>						
						</tr>		
						<tr>
							<td>
								<input <?php if (in_array("_factura_exec", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="_factura_exec" id="_factura_exec" />
								<label for="_factura_exec"><?php echo LANG_factura_exec; ?></label>
							</td>						
						</tr>
						<tr>
							<td>
								<input <?php if (in_array("_carnet_tir_exec", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="_carnet_tir_exec" id="_carnet_tir_exec" />
								<label for="_carnet_tir_exec"><?php echo LANG_carnet_tir_exec; ?></label>
							</td>						
						</tr>
						<tr>
							<td>
								<input <?php if (in_array("_decl_vamala_exec", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="_decl_vamala_exec" id="_decl_vamala_exec" />
								<label for="_decl_vamala_exec"><?php echo LANG_decl_vamala_exec; ?></label>
							</td>						
						</tr>
						<tr>
							<td>
								<input <?php if (in_array("_text_alte_acte_exec", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="_text_alte_acte_exec" id="_text_alte_acte_exec" />
								<label for="_text_alte_acte_exec"><?php echo LANG_text_alte_acte_exec; ?></label>
							</td>													
						</tr>						
					</table>
				</fieldset>			
			</td>
			<td valign="top">
				<fieldset>
					<legend><?php echo LANG_Acte_Sol; ?></legend>
					<table>
						<tr>
							<td>
								<input <?php if (in_array("_cmr_sol", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="_cmr_sol" id="_cmr_sol" />
								<label for="_cmr_sol"><?php echo LANG_cmr_sol; ?></label>
							</td>
						</tr>
						<tr>
							<td>
								<input <?php if (in_array("_factura_sol", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="_factura_sol" id="_factura_sol" />
								<label for="_factura_sol"><?php echo LANG_factura_sol; ?></label>
							</td>							
						</tr>	
						<tr>
							<td>
								<input <?php if (in_array("_carnet_tir_sol", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="_carnet_tir_sol" id="_carnet_tir_sol" />
								<label for="_carnet_tir_sol"><?php echo LANG_carnet_tir_sol; ?></label>
							</td>						
						</tr>		
						<tr>
							<td>
								<input <?php if (in_array("_decl_vamala_sol", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="_decl_vamala_sol" id="_decl_vamala_sol" />
								<label for="_decl_vamala_sol"><?php echo LANG_decl_vamala_sol; ?></label>
							</td>						
						</tr>		
						<tr>
							<td>
								<input <?php if (in_array("_text_alte_acte_sol", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="_text_alte_acte_sol" id="_text_alte_acte_sol" />
								<label for="_text_alte_acte_sol"><?php echo LANG_text_alte_acte_sol; ?></label>
							</td>								
						</tr>									
					</table>
				</fieldset>			
			</td>
			<td valign="top">
				<fieldset>
					<legend><?php echo LANG_Contacte; ?></legend>
					<table>
						<tr>
							<td>
								<input <?php if (in_array("id_contact_sol", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="id_contact_sol" id="id_contact_sol" />
								<label for="id_contact_sol"><?php echo LANG_Contact_sol; ?></label>
							</td>
						</tr>
						<tr>
							<td>
								<input <?php if (in_array("id_contact_exec", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="id_contact_exec" id="id_contact_exec" />
								<label for="id_contact_exec"><?php echo LANG_Contact_exec; ?></label>
							</td>							
						</tr>	
						<tr>
							<td>
								<input <?php if (in_array("coment_sol", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="coment_sol" id="coment_sol" />
								<label for="coment_sol"><?php echo LANG_Coment_sol; ?></label>
							</td>						
						</tr>		
						<tr>
							<td>
								<input <?php if (in_array("coment_exec", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="coment_exec" id="coment_exec" />
								<label for="coment_exec"><?php echo LANG_Coment_exec; ?></label>
							</td>						
						</tr>										
					</table>
				</fieldset>			
			</td>	
			<td valign="top">
				<fieldset>
					<legend><?php echo LANG_Alte; ?></legend>
					<table>
						<tr>
							<td>
								<input <?php if (in_array("stare_incasare_sol", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="stare_incasare_sol" id="stare_incasare_sol" />
								<label for="stare_incasare_sol"><?php echo LANG_stare_incasare_sol; ?></label>
							</td>
						</tr>
						<tr>
							<td>
								<input <?php if (in_array("stare_plata_exec", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="stare_plata_exec" id="stare_plata_exec" />
								<label for="stare_plata_exec"><?php echo LANG_stare_plata_exec; ?></label>
								</td>
						</tr>	
					</table>					
				</fieldset>
			</td>		
		</tr>
		<tr class="capTabel">
			<td colspan="4" align="center">
				<input type="button" onclick="javascript: save_custom_fields_comand('<?php echo $tip_raspuns; ?>');" value="<?php echo LANG_Chose_custom_fields; ?>"/>
				<input onclick="javascript: closeMessage();" type="button" value="<?php echo LANG_Close; ?>" />
			</td>
		</tr>
        <?php echo output_extra_text_modal(LANG_EXTRA_MODAL_COMENZI_CUSTOM_TABLE, 4); ?>
	</table>
<?php
	flush();
?>